package action;

import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.hibernate.Query;
import org.hibernate.Session;

import po.Address;
import po.User;


import bo.HibernateSessionFactory;

public class AddressUpdateAction {
	
	
	private int id;
	
	private String flag;
	private String name;
	private String email;
	private String belong;
	
	public String execute(){
		
		Session session = HibernateSessionFactory.getSession();
		Address aa = (Address)session.get(Address.class, id);
		aa.setEmail(email);
		aa.setName(name);
		aa.setBelong(belong);
		session.beginTransaction().commit();
		this.setFlag(flag);
		session.close();
		return "addressupdate";
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}
	
}
